<template>
	<div class="news-list">
		<el-row class="news-body" v-for="(item, index) in newsList" :key="index">
			<el-col :span="2">
				<div class="news-index" :class="{ 'red-circle': index < 3 }">{{ index + 1 }}</div>
			</el-col>
			<el-col :span="16">
				<p class="news-title">{{ item.title }}</p>
			</el-col>
			<el-col :span="6">
				<p class="news-subtitle">{{ item.subtitle }}</p>
			</el-col>
		</el-row>
	</div>
</template>

<script setup name="card_list">
const props = defineProps({
	newsList: {
		type: Array,
		default: () => [],
	},
});
</script>

<style lang="scss" scoped>
.news-list {
  height:530px !important;
	.news-body {
		&:last-child {
			border-bottom: none;
		}

		.news-index {
			margin-top: 10px;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 20px;
			height: 20px;
			font-size: 18px;
			font-weight: bold;
			border-radius: 65%;
			border: 2px solid #ccc;

			&.red-circle {
				color: white;
				background-color: red;
				border-color: red;
			}
		}

		.news-title {
			margin: 10px 0;
			font-size: 14px;
			line-height: 1.5;
		}
		.news-subtitle {
			margin: 10px 0;
			font-size: 8px;
			line-height: 1.5;
      float: right;
      color:rgb(88,89,90)
		}

		.news-title {
			font-weight: bold;
		}
	}
}
</style>
